﻿<%@ Page Title="Premium stats - Admin" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
 StylesheetTheme="SkinFile"  CodeBehind="PremiumStats.aspx.cs" Inherits="Nivdal.PremiumStats" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="PremiumStatsTtleLabel" runat="server" Text="Premium general stats" CssClass="white_title" ></asp:Label>
    </div>
    <div class="padding5">

    
        <asp:FormView ID="PremiumStatsFormview" runat="server" DataSourceID="GlobalStatsDataSource">
            <ItemTemplate>
                <table cellpadding="2">
                    <tr>
                        <td>
                            <asp:Label ID="TotalPaymentsTitleLabel" runat="server" Text="Total payments" SkinID="InfoLabel">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="TotalPaymentsLabel" runat="server" Text='<%# Eval("TotalPayments") %>'
                            SkinID="GridLabel"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="TotalEarningsTitleLabel" runat="server" Text="Total earnings" SkinID="InfoLabel">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="TotalEarningsLabel" runat="server" Text='<%# Eval("TotalEarnings") + "$" %>'
                            SkinID="GridLabel"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="UsersWithoutPremiumTitleLabel" runat="server" Text="Active users without premium" SkinID="InfoLabel">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="UsersWithoutPremiumLabel" runat="server" Text='<%# Eval("UsersWithoutPremium") %>'
                            SkinID="GridLabel"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="ActiveUsersPaymentPercentTitleLabel" runat="server" Text="Percent of active users who payed" SkinID="InfoLabel">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="ActiveUsersPaymentPercentLabel" runat="server" Text='<%# Eval("ActivePaymentPercent") + "%" %>'
                            SkinID="GridLabel"></asp:Label>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="GlobalStatsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
          SelectCommand="Nivdal_PremiumGlobalStats" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>

    </div>
    </div>
   
    <div class="basic_element">
    <div class="red_title">
        <asp:Label ID="NoPremiumTitleLabel" runat="server" Text="Active users without premium" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">

    
    <asp:GridView ID="ActiveUsersNoPremiumGrid" runat="server" SkinID="Professional" DataSourceID="ActiveUsersNoPremiumDataSource"
     AutoGenerateColumns="false" PageSize="50" AllowPaging="true">
     <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
        Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
     <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
     <Columns>
        <asp:TemplateField HeaderText="User">
            <ItemTemplate>
                <asp:HyperLink ID="CountryLink" runat="server" NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("CountryId") %>'
                  ImageUrl='<%# "~/Images/Flags/" + Eval("Flag") %>' ToolTip='<%# Eval("CountryName") %>'></asp:HyperLink>
                <asp:HyperLink ID="UserLink" runat="server" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>'
                 SkinID="GreenTitleHyperLink" Text='<%# Eval("UserName") %>'></asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Last activity time">
            <ItemTemplate>
                <asp:Label ID="LastLoginLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("LastLoginDate") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Create date">
            <ItemTemplate>
                <asp:Label ID="CreateDateLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("CreateDate") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <HeaderTemplate>
                <asp:Label ID="LoginsNumHeaderLabel" runat="server" SkinID="GridLikeLable" Text="Num Logins"
                  ToolTip="Number of logins since the premium expired"></asp:Label>
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label ID="NumLoginsLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("NumLogins") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
     </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="ActiveUsersNoPremiumDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
      SelectCommand="Nivdal_GetUsersWithoutPremium" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>

    </div>
    </div>
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="ShopPaymentsTitleLabel" runat="server" SkinID="SubHeaderLabel" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">

    <asp:GridView ID="ShopPaymentsGridview" runat="server" DataSourceID="ShopPaymentsDataSource" AllowPaging="true"
     PageSize="30" AutoGenerateColumns="false" SkinID="Professional" >
     <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
        Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
     <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
     <Columns>
        <asp:TemplateField HeaderText="Date">
            <ItemTemplate>
                <asp:Label ID="CreateDateLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("Date") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Payed">
            <ItemTemplate>
                <asp:HyperLink ID="CountryLink" runat="server" NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("PayedCountryId") %>'
                  ImageUrl='<%# "~/Images/Flags/" + Eval("PayedFlag") %>' ToolTip='<%# Eval("PayedCountryName") %>'></asp:HyperLink>
                <asp:Hyperlink ID="UserLink" runat="server" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("PayedUserId") %>'
                 Text='<%# Eval("PayedUserName") %>' SkinID="GreenTitleHyperLink"></asp:Hyperlink>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Payed for">
            <ItemTemplate>
                <asp:Panel ID="PayedForPanel" runat="server" Visible='<%# Eval("ForVisible") %>'>
                    <asp:HyperLink ID="CountryLink" runat="server" NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("ForCountryId") %>'
                      ImageUrl='<%# "~/Images/Flags/" + Eval("ForFlag") %>' ToolTip='<%# Eval("ForCountryName") %>'></asp:HyperLink>
                    <asp:Hyperlink ID="UserLink" runat="server" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("ForUserId") %>'
                     Text='<%# Eval("ForUserName") %>' SkinID="GreenTitleHyperLink"></asp:Hyperlink>
                 </asp:Panel>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Tournament">
            <ItemTemplate>
                <asp:HyperLink ID="TournamentLink" runat="server" Visible='<%# Eval("TournamentVisible") %>' SkinID="GreenTitleHyperLink"
                 NavigateUrl='<%# "~/Tournament.aspx?Id=" + Eval("TournamentId") %>' Text='<%# Eval("TournamentName") %>'></asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="$">
            <ItemTemplate>
                <asp:Label ID="AmmountLabel" runat="server" Text='<%# Eval("Ammount") %>' SkinID="GridLabel"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>

     </Columns>     
    </asp:GridView>
    <asp:SqlDataSource ID="ShopPaymentsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
      SelectCommand="Nivdal_GetShopPayments" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, Preferences_PageNameLabel %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
